package com.ayq.activiti.manager.dto;

import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>流程实例模型</p>
 * <p>方法名:</p>
 *
 * @Author ayq
 * @Date 2021/3/12 11:45
 */
public class DeploymentDTO implements Serializable {

    private static final long serialVersionUID = -8090263343806411410L;

    public DeploymentDTO(Deployment deployment, ProcessDefinition processDefinition) {
        this.id = processDefinition.getId();
        this.dName = deployment.getName();
        this.dKey = deployment.getKey();
        this.deploymentTime = deployment.getDeploymentTime();
        this.deploymentId = deployment.getId();
        this.engineVersion = processDefinition.getEngineVersion();
        this.pName = processDefinition.getName();
        this.pKey = processDefinition.getKey();
        this.version = processDefinition.getVersion();
        this.resourceName = processDefinition.getResourceName();
        this.diagramResourceName = processDefinition.getDiagramResourceName();
        this.isSuspended = processDefinition.isSuspended();
    }

    private String id;

    private boolean isSuspended;

    private String dName;

    private String dKey;

    private Date deploymentTime;

    private String engineVersion;

    private String pName;

    private String pKey;

    private int version;

    private String deploymentId;

    private String resourceName;

    private String diagramResourceName;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public boolean isSuspended() {
        return isSuspended;
    }

    public void setSuspended(boolean suspended) {
        isSuspended = suspended;
    }

    public String getdName() {
        return dName;
    }

    public void setdName(String dName) {
        this.dName = dName;
    }

    public String getdKey() {
        return dKey;
    }

    public void setdKey(String dKey) {
        this.dKey = dKey;
    }

    public Date getDeploymentTime() {
        return deploymentTime;
    }

    public void setDeploymentTime(Date deploymentTime) {
        this.deploymentTime = deploymentTime;
    }

    public String getEngineVersion() {
        return engineVersion;
    }

    public void setEngineVersion(String engineVersion) {
        this.engineVersion = engineVersion;
    }

    public String getpName() {
        return pName;
    }

    public void setpName(String pName) {
        this.pName = pName;
    }

    public String getpKey() {
        return pKey;
    }

    public void setpKey(String pKey) {
        this.pKey = pKey;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getDeploymentId() {
        return deploymentId;
    }

    public void setDeploymentId(String deploymentId) {
        this.deploymentId = deploymentId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getDiagramResourceName() {
        return diagramResourceName;
    }

    public void setDiagramResourceName(String diagramResourceName) {
        this.diagramResourceName = diagramResourceName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "DeploymentDTO{" +
                "id='" + id + '\'' +
                ", isSuspended=" + isSuspended +
                ", dName='" + dName + '\'' +
                ", dKey='" + dKey + '\'' +
                ", deploymentTime=" + deploymentTime +
                ", engineVersion='" + engineVersion + '\'' +
                ", pName='" + pName + '\'' +
                ", pKey='" + pKey + '\'' +
                ", version=" + version +
                ", deploymentId='" + deploymentId + '\'' +
                ", resourceName='" + resourceName + '\'' +
                ", diagramResourceName='" + diagramResourceName + '\'' +
                '}';
    }
}
